server {
    server_name xxxxxxxxx;
    
    #index index.php index.html;
    access_log /var/log/nginx/vps-access.log;
    error_log /var/log/nginx/vps-error.log error;
    root /home/vps/public_html;
    
    location / {
       index  index.html index.htm index.php;
       try_files $uri $uri/ /index.php?$args;
    }

    location ~\.php$ {
        #sesuaikan dengan versi php yang digunakan atau gunakan upstream
        #fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #include fastcgi_params;
        #include snippets/fastcgi-php.conf;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~* /(?:uploads|files)/.*\.php$ {
        deny all;
    }

    # Media: images, icons, video, audio, HTC
    location ~* \.(jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
         expires 356d;
       # access_log off;
         add_header Cache-Control "public, no-transform";
    }

    # CSS and Javascript
    location ~* \.(css|js)$ {
         expires 2d;
       # access_log off;
         add_header Cache-Control "public, no-transform";
    }

    listen 443 ssl;
    ssl_certificate /etc/v2ray/v2ray.crt;
    ssl_certificate_key /etc/v2ray/v2ray.key; 
    #include /etc/letsencrypt/options-ssl-nginx.conf; 
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;;
    
}

#server { 
 #    listen 80;
  #   server_name xxxxxxxxx;
  #   return 301 https://$host$request_uri;
 #}
